package com.wash.shoes.common.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 质检状态枚举
 */
@Getter
@RequiredArgsConstructor
public enum QualityInspectStatusEnum {
    WAIT_INSPECT("WAIT_INSPECT", "待质检"),
    INSPECTED("INSPECTED", "质检完成");
    @EnumValue
    private final String code;
    private final String desc;

    @JsonCreator
    public static QualityInspectStatusEnum getByCode(String code) {
        for (QualityInspectStatusEnum value : QualityInspectStatusEnum.values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
